#include<iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <map>
using namespace std;
class Solution {
public:
    int searchInsert(vector<int>& nums, int target) {
        if (nums.size() == 0)return 0;
        int z, y, mid;
        z = 0, y = nums.size() - 1;
        while (z <= y)
        {
            mid = z + y;
            mid /= 2;
            if (nums[mid] == target)return mid;
            if (nums[mid] < target)z = mid + 1;
            else y = mid - 1;
        }
        if (nums[mid] < target)mid++;
        return mid;
    }
};
int main()
{
    Solution sol;
}